import React from "react";
import ReactDOM from "react-dom/client";
import { BrowserRouter } from "react-router-dom";
import { loadableReady } from "@loadable/component";
import App from "./App";
async function renderApp() {
	// await loadableReady();
	// ReactDOM.hydrateRoot(
	// 	document.getElementById("root"),
	// 	<BrowserRouter>
	// 		<App />
	// 	</BrowserRouter>
	// );
	loadableReady(() => {
		ReactDOM.hydrateRoot(
			document.getElementById("root"),
			<BrowserRouter>
				<App />
			</BrowserRouter>
		);
	})
}
renderApp();

// 热更新
!(module as any).hot?.accept(async () => {
	renderApp();
});
